USE [AnotherSuccessfulProcedure]

IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[AssistsSelectCountByPlayerIdLogId]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
BEGIN
	DROP PROCEDURE dbo.AssistsSelectCountByPlayerIdLogId
END


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Neil Wilson
-- Create date: 09/03/08
-- Description:	Assists Table Select Count By PlayerId and LogId
-- =============================================
CREATE PROCEDURE AssistsSelectCountByPlayerIdLogId

            @LogId int,
			@PlayerId varchar(30),
			@AssistCount int = 0 OUTPUT
	
AS

BEGIN

select @AssistCount = COUNT(AssistId) FROM Assists WHERE LogId = @LogId AND assister_PlayerId = @PlayerId


END
GO
